home *** CD-ROM | disk | FTP | other *** search
- Path: news.compulink.gr!athena!lonewolf
- From: lonewolf@athena.compulink.gr (Costas Vlassis)
- Newsgroups: comp.lang.c
- Subject: strncpy() ?
- Date: 21 Apr 1996 15:41:33 GMT
- Organization: CompuLink Network S.A.
- Message-ID: <4ldkvd$553@venus.compulink.gr>
- NNTP-Posting-Host: 193.92.197.99
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- Well I have this question, let's say we have the following :
-
- char alfa[40] = "1123";
- char beta[20];
- char gama[20];
-
- With strncpy(beta,alfa,2) beta = "11" that's fine but HOW can I make
- gama = "23" that is the last 2 characters of alfa or even "3" the last
- character... Is there a function that takes start and end as strings ?
-
- what I want is something like :
-
- strncpy2 (beta,alfa,2,4);
-
- is this possible ?
-
- Costas Vlassis
- lonewolf@compulink.gr
-
-